package com.example.lt.context;

/**
 * @Author 小涛Tao
 * @Date: 2024/05/30/23:03
 * version 1.0 注释：线程本地变量，用来存储当前登录者的id
 **/
public class BaseContext {

    public static ThreadLocal<Integer> threadLocal = new ThreadLocal<>();

    public static void setCurrentId(Integer id) {
        threadLocal.set(id);
    }

    public static Integer getCurrentId() {
        return threadLocal.get();
    }

    public static void removeCurrentId() {
        threadLocal.remove();
    }

}
